package com.zut.controller;

import com.zut.Pojo.Result;
import com.zut.Service.Search;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
* @Author: 无恙
* @Description:搜索或分类查询接口
*/
@RequestMapping("/problem")
@RestController
public class SearchController {

    @Autowired
    private Search search;
    /**
     * 搜索接口
     * @param keyWords
     * @return
     */
    @GetMapping("/search")
    public Result search(String keyWords){

        return search.searchByKeyWords(keyWords);
    }

    /**
     * 标签搜素接口
     * @param tag
     * @return
     */
    @GetMapping("/tag/search")
    public Result searchByTag(String tag){

        return search.searchByTag(tag);
    }
}
